Update create_or_update_file SHA Arg Description#651
Merged
LuluBeatson merged 3 commits intomainfrom Jul 8, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR clarifies the documentation for the sha parameter in the create_or_update_file function to make it explicit that the SHA is required when updating existing files. The updated description aligns with GitHub's REST API documentation and helps prevent errors where agents attempt to update files without providing the necessary blob SHA.
- Updates parameter description to explicitly state SHA requirement for file updates
- Aligns documentation with GitHub's official REST API specification
- Updates both code documentation and README to maintain consistency
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/github/repositories.go | Updates the SHA parameter description in the function definition |
| pkg/github/toolsnaps/create_or_update_file.snap | Updates the corresponding test snapshot with new description |
| README.md | Updates user-facing documentation to reflect the clarified parameter description |
tonytrg
approved these changes
Jul 8, 2025
nickytonline
pushed a commit
to nickytonline/github-mcp-http
that referenced
this pull request
Oct 4, 2025
* sha arg prompt as required if updating file * generate docs and toolsnaps * shorten
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clarifies that
shais required if updating an existing file.Fixes agent trying to update a file without providing the blob SHA.
New description is also more aligned to the API docs for this parameter
https://docs.github.com/en/rest/repos/contents?apiVersion=2022-11-28#create-or-update-file-contents
Relates to #605 because we would like to allow the agent get thee blob SHA using
get_file_contentstoolcc @audreee
ref:
https://github.com/github/copilot-productivity/issues/6450